package com.epam.chenjo.ms.employeeservice.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.epam.chenjo.ms.employeeservice.model.EmployeeDetails;
import com.epam.chenjo.ms.employeeservice.service.EmployeeService;

@RestController
public class EmployeeController {
	@Autowired
	private EmployeeService employeeService;
	
	@RequestMapping("/greetings")
	public String sayHello(){
		return "Hello I am here";
	}
	
	 @RequestMapping(value="/employee/{empId}", method=RequestMethod.GET) 
	    public EmployeeDetails employeeDetails(@PathVariable String empId) { 
	        return employeeService.getEmployeeDetails(empId); 
	    } 
}

